home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor1 / trac.doc < prev    next >
Text File  |  1995-03-31  |  8KB  |  127 lines

  1. by Jeff Broido 
  2.                                TRAC.DOC file 
  3.  
  4.                Copyright 1990 by Broido Computer Consulting. 
  5.                 All rights reserved.  The right is granted 
  6.                     to anyone to copy these materials, 
  7.                         but they must not be sold. 
  8.  
  9.  
  10. OVERVIEW 
  11. -------- 
  12.  
  13. The HP48SX Print Trace system provides a facility for the HP48SX externally 
  14. similar to the built-in print trace feature of the HP28C and HP28S.  This  
  15. facility of the 28s allows you to trace almost all calculator operations to 
  16. an 82240A or 82240B thermal printer.  The HP48SX provides no native print  
  17. trace feature, but does provide a generalized facility called "Vectored  
  18. ENTER" which I have used to implement this system.  Note that my output  
  19. format is almost identical to that of the HP28 series calculators.  I chose 
  20. this format for consistency, not because I find it aesthetically pleasing.  
  21. This system can be modified by the user to print in almost any format  
  22. desired. 
  23.  
  24. PROCEDURE 
  25. --------- 
  26.  
  27.  1. Using Kermit, load TRAC into the HOME directory.  For your reference,  
  28.     the BYTES command yields a checksum of # D720h and a size of 780.5  
  29.     bytes. 
  30.  
  31.  2. Optional: Put 'TRAC' on stack level 2 and 81.2 on stack level 1.  Go to 
  32.     the right-shift-MODES menu and hit ASN.  This will assign TRAC to user  
  33.     keyboard position 81.2, or left-shift-right-shift.  In other words, if  
  34.     the HP48SX is in user mode, hitting the orange key followed by the blue 
  35.     key will evaluate the TRAC function.  To put your calculator into user  
  36.     keyboard mode, hit left-shift-USR twice.  If you are successful, the  
  37.     USER annunciator will appear just below the top line of the display. 
  38.  
  39.  3. To toggle between tracing mode and normal mode, either type TRAC, hit  
  40.     the TRAC key from the HOME menu or, if you've performed optional step  
  41.     2. above, do a left-shift-right-shift (orange followed by blue).   
  42.     Either "Print trace on." or "Print trace off." will appear at the top  
  43.     of the stack display as appropriate. 
  44.  
  45.  
  46. SYSTEM DESCRIPTION 
  47. ------------------ 
  48.  
  49. IMPORTANT NOTE: in this document, [alpha] refers to the greek lowercase  
  50. alpha which is accessed in alhpa mode, right-shift A and [beta] refers to  
  51. the greek lowercase beta which is accessed in alpha mode right shift B.   
  52. For example, if I mention a variable named '[beta]ENTER', to type the name  
  53. you would hit the apostrophe key followed by the alpha key twice (to put  
  54. the calculator in alpha mode) followed by right-shift B followed by E, N,  
  55. T, E and R. 
  56.  
  57. This Print Trace system uses an as-yet undocumented facility called  
  58. "Vectored ENTER."  The only reference so far to this facility is in  
  59. Appendix E of the HP48SX Owner's Manual.  This states that when flag -63 is 
  60. set, User-defined ENTER is activated.  I am indebted to Ron at the Hewlett- 
  61. Packard Calculator Support department, Corvalis, OR for explaining it  
  62. further.  To summarize his explanation and my findings: 
  63.  
  64.     If "Vectored ENTER" mode (flag -63) is set and the calculator is in  
  65.     USER (NOT 1USR) mode (via the keyboard or setting flag -62) 
  66.  
  67.     AND     There is a variable named '[alpha]ENTER' in the current path,  
  68.             BEFORE any operation, whenever the command line would normally  
  69.             be pushed to the stack, it is pushed to stack level 1 delimited 
  70.             by " characters on either end instead.  Following this action,  
  71.             the variable named '[alpha]ENTER' is evaluated.  Typically  
  72.             [alpha]ENTER would be a program.  If the contents of the  
  73.             command line are not a single string, this action causes the  
  74.             entire command line to be placed on the stack as a single  
  75.             string.  If it was already a string, it winds-up on the stack  
  76.             with an extra set of delimiting " characters.  This means that  
  77.             if either the OBJ-> or STR-> command is executed in the  
  78.             [alpha]ENTER program, the stack will contain precisely what it  
  79.             would have if the calculator were not in Vectored ENTER mode. 
  80.  
  81.     AND/OR  There is a variable named '[beta]ENTER' in the current path,  
  82.             AFTER any operation is performed, the name of the operation is  
  83.             placed on stack level 1 as a string.  PURGE and ENTER itself  
  84.             are represented by the null string ("").  If, however, ENTER is 
  85.             acting as DUP, "DUP" is returned.  If the operation is  
  86.             unsuccessful, its name is not placed on the stack.  Menu  
  87.             navigation is not reported, but path navigation is. 
  88.  
  89. The TRAC function checks a list in the home directory with the name  
  90. '[alpha][beta]FG'.  If the first element of the list indicates that tracing 
  91. is off (or the list doesn't exist), tracing is turned on and that fact is  
  92. indicated in the first element of the list.  If the first element of the  
  93. list indicates that tracing is on, it is turned off and similarly noted.  
  94. When tracing is turned on, the state of flag -62 is indicated in element 2  
  95. of the '[alpha][beta]FG' list.  When tracing is turned off, the former  
  96. state of flag -62 is restored.  In other words, if the calculator was in  
  97. USER mode when tracing was turned on, it is left in USER mode when it is  
  98. turned off.  If the calculator was not in USER mode when tracing was turned 
  99. on, it is taken out of USER mode when tracing is turned off.  This is  
  100. necessary since the Vectored ENTER mode is only effective if the calculator 
  101. is also in USER mode.  To turn tracing on, TRAC sets flags -62 and -63 and  
  102. places programs in variables named '[alpha]ENTER' and '[beta]ENTER' in the  
  103. HOME directory.  To turn tracing off, TRAC clears flag -63 and when  
  104. appropriate clears flag -62 and purges the variables named '[alpha]ENTER'  
  105. and '[beta]ENTER' from the home directory.   
  106.  
  107. The [alpha]ENTER program simply makes a copy of the command line as a  
  108. string padded on the right with a blank in variable [alpha][beta]ENTER and  
  109. executes the OBJ-> command to leave the stack in the same state it would  
  110. have been in had Vectored ENTER not been in effect. 
  111.  
  112. The [beta]ENTER program concatenates the current function to the end of the 
  113. command line saved in [alpha][beta]ENTER and prints it.  If there is no  
  114. variable [alpha][beta]ENTER, this means that there was no command line and  
  115. [beta]ENTER simply prints the operation.  After it has done this,  
  116. [beta]ENTER prints level 1 of the stack prefixed by the characters "1: "  
  117. unless the stack is empty, in which case it prints the character string  
  118. "[Empty Stack]".  [beta]ENTER then prints 0000300000081000000810000000700000060000000081FFFFF1000000000EFFFF300000000000EFF7000000 
  119. GROB 64 64 0000006FF700000000000EDBFF30000000008BFFFFF100000000FEFFFFF700000008FFFFFFFF100000067FFFFFFF3000000BFFFFFFFFF0000089FFFFFFFFF100006CFFFFFFFFF300003FFFFFFFFFF700089FFFFFFFFFFF0008C7DFFFFFFFFF100CCF7FFFFFFFFF3006CF3EFFFFFFFF300BEFB3EFFFFFFF7001FFFFFFFFFFFF708DFFFFFFFFFFFFF08CFFFFFFFFFFFFF14EFFFFFFFFFFFFF14EFFFFFFF3EFFFF16FFFFFFFF3CFFF722FFFFF7FF10F7F736FFFFFFFF10F3E77EFFFFFFF300F1E779FFFFFFF400E1A769FFFFFFFF00 nothing when you turn tracing on and 
  120.     prints TRAC when you turn it off. 
  121.  
  122. If you find any other differences or problems, please post them as  
  123. responses to this entry.  If you have any questions, don't hesitate to call 
  124. me at (201) 455-0362.  Good luck!            
  125.  
  126.                                                    Jeff Broido 
  127.